#include<bits/stdc++.h>
using namespace std;
#define n 4
double coin[n] = {0.25,0.1,0.05,0.01};

int coun = 0;
int GiveChange(double money){
    bool flag = false;
    if(money==0){
        return 0;
    }
    for(int i=0;i<n;i++){
        if(money >= coin[i]){
            money-=coin[i];
            coun++;
            flag = true;
            break;
        }
    }
    if(money>0&&money<0.01){
        flag=true;
        money = 0;
    }
    if(flag){
        return 1+GiveChange(money);
    }
    else{
        return 0;
    }
}

int main(){
    double m = 4.77;
    cout<<GiveChange(m);
    return 0;
}
